<div class="fm-content">
    <!-- 最上面标题栏 -->
    <div class="title">
        <i nz-icon [type]="'desktop'"></i>
        &nbsp;&nbsp;安保设备
    </div>
    <!-- 内容 -->
    <div class="work">
        <div class="top">
            <nz-select class="fm-input first-input" (nzOpenChange)="unitDic.load('0')" [(ngModel)]="fs.queryObject['useUnit:=']"
                [nzPlaceHolder]="'所在单位'">
                <nz-option *ngFor="let option of unitDic.datas" [nzLabel]="option.display" [nzValue]="option.id">
                </nz-option>
                <nz-option *ngIf="unitDic.isLoading" nzDisabled nzCustomContent>
                    <i nz-icon type="loading" class="loading-icon"></i>加载中...
                </nz-option>
            </nz-select>
            <nz-select class="fm-input" (nzOpenChange)="typeDic.load('0')"
                [(ngModel)]="fs.queryObject['equipmentType:=']" [nzPlaceHolder]="'设备类型'">
                <nz-option *ngFor="let option of typeDic.datas" [nzLabel]="option.display" [nzValue]="option.id">
                </nz-option>
                <nz-option *ngIf="typeDic.isLoading" nzDisabled nzCustomContent>
                    <i nz-icon type="loading" class="loading-icon"></i>加载中...
                </nz-option>
            </nz-select>
            <nz-select class="fm-input" (nzOpenChange)="modelDic.load('0')"
                [(ngModel)]="fs.queryObject['equipmentModel:=']" [nzPlaceHolder]="'设备型号'">
                <nz-option *ngFor="let option of modelDic.datas" [nzLabel]="option.display" [nzValue]="option.id">
                </nz-option>
                <nz-option *ngIf="modelDic.isLoading" nzDisabled nzCustomContent>
                    <i nz-icon type="loading" class="loading-icon"></i>加载中...
                </nz-option>
            </nz-select>
            <nz-button-group>
                <button nz-button nzType="primary" (click)="fs.loadData(true)">查询</button>
                <button nz-button
                    (click)="fs.resetQueryObject() && fs.loadData(true)">重置</button>
            </nz-button-group>
            <div class="tool-right">
                <nz-button-group>
                    <button *ngIf="ss.mi.sa || ss.mi.abssxz" nz-button [nzType]="'primary'" (click)="editRow(null)">新增</button>
                    <!-- <button nz-button (click)="fs.editRow()">编辑</button> -->
                    <button *ngIf="ss.mi.sa || ss.mi.absssc" nz-popconfirm nzTitle="确认删除选择项?" (nzOnConfirm)="fs.delEntitys()" nzPlacement="bottomRight"
                        nz-button>删除</button>
                  <a nz-button href="assets/images/安保设备.xls" download="安保设备.xls">模板下载</a>
                  <button nz-button (click)="fs.export('xjmh_absb.html', '安保设备.xls')">导出</button>
                  <nz-upload nzAction="{{ fs.getExcelUploadUrl() }}" [nzLimit]="1" [nzHeaders]="ffs.fileHeaders"
                             [nzFilter]="fs.excelFilters" [nzAccept]="'.xls,.xlsx'" (nzChange)="excelHandleChange($event)">
                    <button *ngIf="ss.mi.sa || ss.mi.abssxz" nz-button>导入</button>
                  </nz-upload>
                </nz-button-group>
            </div>
        </div>

        <!-- 右则样表单主体 -->
        <div class="work-content">
            <div class="table">
                <nz-table nzSize="middle" nzShowSizeChanger [nzPageSizeOptions]='[ 10, 15, 20, 30, 40, 50 ]'
                    [nzFrontPagination]="false" [nzData]="fs.datas" [nzLoading]="fs.isLoading || fs.isDeleing"
                    [nzTotal]="fs.rowsCount" [(nzPageIndex)]="fs.pageIndex" [(nzPageSize)]="fs.pageSize"
                    (nzPageIndexChange)="fs.loadData()" (nzPageSizeChange)="fs.loadData(true)"
                    [nzScroll]="{ x: '1000px' }">
                    <thead>
                        <tr>
                            <th nzWidth="50px" nzShowCheckbox [(nzChecked)]="fs.allChecked"
                                [nzIndeterminate]="fs.indeterminate" (nzCheckedChange)="fs.checkAll($event)"></th>
                            <th nzWidth="50px">设备类型</th>
                            <th nzWidth="100px">设备型号</th>
                            <th nzWidth="100px">设备序列</th>
                            <th nzWidth="100px">生产厂家</th>
                            <th nzWidth="50px">出厂年</th>
                            <th nzWidth="50px">出厂月</th>
                            <th nzWidth="50px">启用年</th>
                            <th nzWidth="50px">启用月</th>
                            <th nzWidth="100px">安装位置</th>
                            <th nzWidth="100px">使用单位</th>
                            <th nzWidth="100px">所属监管局</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr *ngFor="let data of fs.datas">
                            <td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="fs.refreshCheckStatus()">
                            </td>
                            <!-- <td><span (click)="fs.editRow(data)" class="form-edit"></span></td> -->
                            <td>{{data.equipmentTypeName}}</td>
                            <td>{{data.equipmentModelName}}</td>
                            <td><span (click)="editRow(data)" class="form-edit">{{data.equipmentSerial}}</span></td>
                            <td>{{data.produceFactoryName}}</td>
                            <td>{{data.outYear}}</td>
                            <td>{{data.outMonth}}</td>
                            <td>{{data.useYear}}</td>
                            <td>{{data.useMonth}}</td>
                            <td>{{data.position}}</td>
                            <td>{{data.useUnitName}}</td>
                            <td>{{data.regulatoryAuthorityName}}</td>
                        </tr>
                    </tbody>
                </nz-table>
            </div>
        </div>

    </div>
</div>
